<?php
include("connection/connection.php");
if(isset($_POST['add_new']))
{
$loc_id=$_POST['loc_id'];

$source=$_POST['source'];
$Location=$_POST['Location'];
$Longitude=$_POST['Longitude'];
$Latitude=$_POST['Latitude'];
$source_status=$_POST['source_status'];
$yeildMin=$_POST['yeildMin'];
$yeildMax=$_POST['yeildMax'];
$waterMin=$_POST['waterMin'];
$waterMax=$_POST['waterMax'];

$pH=$_POST['pH'];
$TDS=$_POST['TDS'];
$cl=$_POST['cl'];
$F=$_POST['F'];
$no3=$_POST['no3'];

$qr="insert into tbl_dtls_q1_sws(id,loc_id,source,location,longitude,latitude,yield_min,yield_max,water_table_min,water_table_max,pH,TDS,Cl,F,no3,current_status) values('','$loc_id','$source','$Location','$Longitude','$Latitude','$yeildMin','$yeildMax','$waterMin','$waterMax','$pH','$TDS','$cl','$F','$no3','$source_status')";
$res=mysql_query($qr);
if($res)
{
$update_query="update tbl_dtls_q1_main set no_sources=(no_sources+1) where id='$loc_id'";
$res=mysql_query($update_query);
header("location:q1_rwss_edit.php");
}
}		
?>